#include "StdAfx.h"
#include "Afactor.h"
#include "Aidentity.h"
#include "Alog.h"
// depend on actual project;
#include "Alog.h"
#include "Atest.h"

Afactor * gafactor = NULL;

Afactor::Afactor(void)
{
	galog = new Alog();
	gidentity = new Aidentity();

	Alog::s_setHead(_T("->ALib-"));
	gatest = new Atest();

	Alog::s_out(_T("->Afactor.create(): end.\r\n"));
}

Afactor::~Afactor(void)
{
	Alog::s_out(_T("->Afactor.destory(): in.\r\n"));
	if( gatest) { delete gatest; gatest = NULL;}
	if( gidentity) { delete gidentity; gidentity = NULL; }
	if( galog) { delete galog; galog = NULL; }
}

int Afactor::init()
{
	int d = gatest->ainit();

	if( d>=0) d = initsub();

	return d;
}
void Afactor::exit()
{
	exitsub();

	gatest->aexit();
}
